<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用人单位信息管理--增加</title>
<link href="<%=request.getContextPath()%>/css/reset.css" rel="stylesheet" type="text/css"/>
<link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css"/>
<script language="javascript" src="<%=request.getContextPath()%>/js/meizzDate.js"></script>
<script type="text/javascript">
	function selectEmployer(){
		var arr = showModalDialog("<%=request.getContextPath()%>/EmployerInfo.do?method=find", "", "dialogWidth:550pt;dialogHeight:400pt;help:0;status:0");
		if(arr != null){
			var id = arr[0][0];
			var name = arr[0][1];
			document.form1.supvInfoUnitId.value = id;
			document.form1.unit.value = name;
		}
	}
	function changeType(){
		var frm = document.form1;
		if(frm.supvInfoType.value == "2"){
			frm.supvInfoPensonNum.disabled = false;
			frm.supvInfoMoney.disabled = false;
		}else if(frm.supvInfoType.value == "3"){
			frm.supvInfoPensonNum.disabled = false;
			frm.supvInfoMoney.disabled = true;
		}else{
			frm.supvInfoPensonNum.disabled = true;
			frm.supvInfoMoney.disabled = true;
		}
	}
	function check(){
		var frm = document.form1;
		if(frm.supvInfoUnitId.value == ""){
			alert("请选择被检查单位！");
			return false;
		}
		if(frm.supvInfoDate.value == ""){
			alert("请选择监察日期！");
			return false;
		}
		if(frm.supvInfoType.value == "2"){
			if(frm.supvInfoPensonNum.value == ""){
				alert("请输入涉及人数！");
				frm.supvInfoPensonNum.focus();
				return false;
			}
			if(isNaN(frm.supvInfoPensonNum.value)){
				alert("涉及人数应为数字！");
				frm.supvInfoPensonNum.focus();
				return false;
			}
			if(frm.supvInfoMoney.value == ""){
				alert("请输入涉及金额！");
				frm.supvInfoMoney.focus();
				return false;
			}
			if(isNaN(frm.supvInfoMoney.value)){
				alert("涉及金额应为数字！");
				frm.supvInfoMoney.focus();
				return false;
			}
		}else if(frm.supvInfoType.value == "3"){
			if(frm.supvInfoPensonNum.value == ""){
				alert("请输入涉及人数！");
				frm.supvInfoPensonNum.focus();
				return false;
			}
			if(isNaN(frm.supvInfoPensonNum.value)){
				alert("涉及人数应为数字！");
				frm.supvInfoPensonNum.focus();
				return false;
			}
		}
	}
</script>

</head>

<body>
<form name="form1" action="<%=request.getContextPath()%>/SupervisionInfo.do?method=add" method="post" onsubmit="return check()">
<table width="70%">
  <tr>
    <td width="25%" align="right" class="bg_blue"><p><font color="red">*</font>&nbsp;&nbsp;被检查单位：</p>
    </td>
    <td width="75%" align="left" ><input type="hidden" name="supvInfoUnitId"><input type="text" name="unit" size="30" readonly onclick="javascript:selectEmployer()"> <input class="buttonadd" type="button" value="选择" onclick="javascript:selectEmployer()">&nbsp;</td>
  </tr>
  <tr>
    <td class="bg_blue"align="right"><p><font color="red">*</font>&nbsp;&nbsp;监察日期：</p>
    </td>
    <td align="left"><input type="text" name="supvInfoDate" size="9" onclick="SelectDate(this,'yyyy-MM-dd')" readonly></td>
  </tr>
  <tr>
    <td class="bg_blue"align="right">突发事件：</td>
    <td align="left"><select name="supvInfoEmergency"><option value="1">否</option><option value="0">是</option></select></td>
  </tr>
  <tr>
    <td class="bg_blue"align="right">监察类型：</td>
    <td align="left">
    <select name="supvInfoType" onchange="changeType()">
    <option value="0">日常巡察</option>
    <option value="1">专项检察</option>
    <option value="2">督促缴费</option>
    <option value="3">督促登记</option>
    </select></td>
  </tr>
  <tr>
    <td width="25%" align="right" class="bg_blue"><p>涉及人数：</p>
    </td>
    <td width="75%" align="left" ><input type="text" name="supvInfoPensonNum" maxlength="30" disabled>&nbsp;</td>
  </tr>
  <tr>
    <td width="25%" align="right" class="bg_blue"><p>涉及金额：</p>
    </td>
    <td width="75%" align="left" ><input type="text" name="supvInfoMoney" maxlength="30" disabled>&nbsp;</td>
  </tr>
  <tr>
    <td class="bg_blue"align="right">详细说明：</td>
    <td align="left"><textarea name="supvInfoDetail" cols="50" rows="10"></textarea></td>
  </tr>
  <tr>
    <td class="bg_blue"align="right">备注：</td>
    <td align="left"><input type="text" name="supvInfoRemark" maxlength="1000"></td>
  </tr>
  <tr>
    <td class="nohover" colspan="2" align="center"><input class="buttonsubmit" type="submit" value="提交">&nbsp;<input class="buttonreset" type="reset" value="重置"> <input class="buttonreturn" type="button" value="返回" onClick="javascript:window.location.href='<%=request.getContextPath()%>/SupervisionInfo.do?method=list'"></td>
  </tr>
</table>
</form>
</body>
</html>
